﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 排队算法
{
    class LineUp
    {
        /// <summary>
        /// 班次名称
        /// </summary>
        public string PlanCode { get; set; }
        /// <summary>
        /// 预约开始时间
        /// </summary>
        public string TimeFrom { get; set; }
        /// <summary>
        /// 预约结束时间
        /// </summary>
        public string TimeTo { get; set; }
        /// <summary>
        /// 申请单号
        /// </summary>
        public string ApplyNo { get; set; }
        /// <summary>
        /// 签到顺序
        /// </summary>
        public int SignOrder { get; set; }

        public override string ToString()
        {
            return "班次:"+PlanCode+ ",班次时间:" + TimeFrom+"--"+TimeTo + ",申请单号：" + ApplyNo + ",签到顺序：" + SignOrder;
        }

        public static List<LineUp> Init()
        {
            var result = new List<LineUp>();
            var data1 = new LineUp
            {
                PlanCode="1",
                TimeFrom= "08:00",
                TimeTo= "09:00",
                ApplyNo =new Random().Next(100000,999999).ToString(),
                SignOrder=9,
            };
            var data2 = new LineUp
            {
                PlanCode = "1",
                TimeFrom = "08:00",
                TimeTo = "09:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 8,
            };
            var data3 = new LineUp
            {
                PlanCode = "2",
                TimeFrom = "09:00",
                TimeTo = "10:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 7,
            };
            var data4 = new LineUp
            {
                PlanCode = "2",
                TimeFrom = "09:00",
                TimeTo = "10:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 6,
            };
            var data5 = new LineUp
            {
                PlanCode = "3",
                TimeFrom = "10:00",
                TimeTo = "11:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 5,
            };
            var data6 = new LineUp
            {
                PlanCode = "3",
                TimeFrom = "10:00",
                TimeTo = "11:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 4,
            };
            var data7 = new LineUp
            {
                TimeFrom = "08:00",
                TimeTo = "09:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 3,
            };
            var data8 = new LineUp
            {
                PlanCode = "1",
                TimeFrom = "08:00",
                TimeTo = "09:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 2,
            };
            var data9 = new LineUp
            {
                PlanCode = "1",
                TimeFrom = "08:00",
                TimeTo = "09:00",
                ApplyNo = new Random().Next(100000, 999999).ToString(),
                SignOrder = 1,
            };
           
            result.Add(data1);
            result.Add(data2);
            result.Add(data3);
            result.Add(data4);
            result.Add(data5);
            result.Add(data6);
            result.Add(data7);
            result.Add(data8);
            result.Add(data9);
            return result;
        }
    }
}
